const promise = new Promise((resolve, reject) => {
  resolve("hahaha");
});

promise
  .then((res) => {
    console.log("res:", res);
    return "1111";
  })
  .then((res) => {
    console.log("res1:", res);
    return new Promise((resolve, reject) => {
      setTimeout(() => {
        reject(111111);
      }, 300);
    });
  })
  .then((res) => {
    console.log("res2:", res);
  })
  .catch((err) => {
    console.log("err", err);
    return "3333";
  })
  .then((res) => {
    console.log("res3:", res);
    throw new Error("error");
  })
  .catch((err) => {
    console.log("err2", err);
    return new Promise((resolve, reject) => {
      setTimeout(() => {
        reject(111111);
      }, 300);
    });
  })
  .catch((err) => {
    console.log("err3", err);
  });

setTimeout(() => {
  promise.then((res) => {
    console.log("setTimeoutRes:", res);
  });
}, 5000);
